<?php
/**
 * Created by PhpStorm.
 * User: yu
 * Date: 2017/1/5
 * Time: 下午4:33
 */

namespace Admin\Controller;

use Admin\Model\AdminModel;
use Common\Controller\BaseController;

class LoginController extends BaseController
{
	protected $adminModel;
	public function __init(){
		$this->adminModel = new AdminModel();
	}
	public function login(){

		if(IS_POST){
			if($this->adminModel->checkLogin()){
				$this->success('登录成功',u('admin/index/index'));die;
			}
			$this->error($this->adminModel->getError());
		}else{
			$this->display();
		}
	}
}